<#macro pagination pageNo pageSize recordTotal>
<#assign pageTotal = (((recordTotal%pageSize) == 0)?then(recordTotal/pageSize,(recordTotal/pageSize)+1))?floor>
<div class="row be-datatable-footer">
    <div class="col-sm-5">
        <div class="dataTables_info">
            一共&nbsp;${recordTotal}&nbsp;条数据
        </div>
    </div>
    <div class="col-sm-7">
        <div class="dataTables_paginate paging_simple_numbers">
            <ul class="pagination">
                <#if pageTotal gt 2>
                    <li class="paginate_button page-item previous ${(pageNo == 1)?then('disabled','')}">
                        <a href="?pageNo=${pageNo-1}" class="page-link">
                            上一页
                        </a>
                    </li>
                </#if>
                <#if pageNo &gt; 4>
                    <li class="paginate_button page-item">
                        <a href="?pageNo=1" class="page-link">
                            1
                        </a>
                    </li>
                    <li class="paginate_button page-item">
                        <a href="?pageNo=${pageNo-1}" class="page-link">
                            ...
                        </a>
                    </li>
                </#if>
                <#if pageNo lt 5 && pageTotal gte 5>
                    <#list 1..5 as x>
                        <li class="paginate_button page-item ${(pageNo==x)?then('active','')}">
                            <a href="?pageNo=${x}" class="page-link">
                                ${x}
                            </a>
                        </li>
                    </#list>
                    <#elseif pageNo gt pageTotal-5 && pageTotal gte 5>
                        <#list (pageTotal-4)..pageTotal as x>
                            <li class="paginate_button page-item ${(pageNo==x)?then('active','')}">
                                <a href="?pageNo=${x}" class="page-link">
                                    ${x}
                                </a>
                            </li>
                        </#list>
                    <#elseif pageTotal gte 5&& pageNo gte 5>
                        <#list pageNo-2..pageNo+2 as x>
                                <li class="paginate_button page-item ${(pageNo==x)?then('active','')}">
                                    <a href="?pageNo=${x}" class="page-link">
                                        ${x}
                                    </a>
                                </li>
                        </#list>
                    <#elseif pageTotal lt 5&&pageTotal gt 0>
                        <#list 1..pageTotal as x>
                            <li class="paginate_button page-item ${(pageNo==x)?then('active','')}">
                                <a href="?pageNo=${x}" class="page-link">
                                    ${x}
                                </a>
                            </li>
                        </#list>
                    <#else>
                </#if>
                <#if pageTotal gte 5&&pageNo gte 5&&pageNo lte pageTotal-5>
                    <li class="paginate_button page-item">
                        <a href="?pageNo=${pageNo+4}" class="page-link">
                            ...
                        </a>
                    </li>
                    <li class="paginate_button page-item">
                        <a href="?pageNo=${pageTotal}" class="page-link">
                            ${pageTotal}
                        </a>
                    </li>
                </#if>
                <#if pageTotal gt 0>
                    <li class="paginate_button page-item previous ${(pageNo gt pageTotal-1)?then('disabled','')}">
                        <a href="?pageNo=${pageNo+1}" class="page-link">
                            下一页
                        </a>
                    </li>
                </#if>
            </ul>

        </div>
    </div>
</div>
</#macro>